In [1]:
import graphlab
In [2]:
image_train = graphlab.SFrame('image_train_data/')
image_test = graphlab.SFrame('image_test_data/')
In [3]:
graphlab.canvas.set_target('ipynb')
In [4]:
image_train['image'].show()
In [5]:
raw_pixel_model = graphlab.logistic_classifier.create(image_train, target='label',
features=['image_array'])
In [6]:
image_test[0:3]['image'].show()
In [7]:
image_test[0:3]['label']
Out[7]:
In [8]:
raw_pixel_model.predict(image_test[0:3])
Out[8]:
In [9]:
raw_pixel_model.evaluate(image_test)
Out[9]:
In [11]:
len(image_train)
Out[11]:
In [ ]:
#deep_learning_model = graphlab.load_model('http://s3.amazonaws.com/GraphLab-Datasets/deeplearning/imagenet_model_iter45')
In [ ]:
#image_train['deep_features'] = deep_learning_model.extract_features(image_train)
In [12]:
# Deep features are already computed, use those instead of extracting it using the loaded model
image_train.head(1)
Out[12]:
In [13]:
deep_features_model = graphlab.logistic_classifier.create(image_train, target='label',
features=['deep_features'])
In [14]:
deep_features_model.predict(image_test[0:3])
Out[14]:
In [15]:
deep_features_model.evaluate(image_test)
Out[15]:
In [ ]:
In [ ]:
In [ ]: